package com.tengju.data.infrastructure.repository.clickhouse.convert;

import com.tengju.data.domain.model.clickhouse.LevelUserAnalysis;
import com.tengju.data.domain.model.user.StarLevelEnum;
import com.tengju.data.infrastructure.persistence.mybatis.dataobject.LevelUserAnalysisVO;

/**
 * @author chenhang
 * @Date 2021/3/19
 */
public class UserClubConvert {

    public static LevelUserAnalysis toLevelUserModel(LevelUserAnalysisVO levelUserAnalysisVO) {
        if (levelUserAnalysisVO == null) {
            return null;
        }
        return new LevelUserAnalysis(
                StarLevelEnum.parseByStarLevel(levelUserAnalysisVO.getStarLevel()),
                levelUserAnalysisVO.getCount()
        );
    }
}
